package org.indexador.hadoop.util;

import java.io.*;

import org.apache.hadoop.conf.*;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.fs.FileSystem;

public class AbreArquivoHDFS {
  public static void main(String[] args) throws Exception {
    try {
      Path pt = new Path(
          "hdfs://localhost:9000/user/marcoreis/artigos-wikipedia/ptwiki-20111222-pages-articles.xml");
      FileSystem fs = FileSystem.get(new Configuration());
      BufferedReader br = new BufferedReader(new InputStreamReader(fs.open(pt)));
      String line;
      line = br.readLine();
      while (line != null) {
        System.out.println(line);
        line = br.readLine();
      }
    } catch (Exception e) {
    }
  }
}